const path = require('path')
const Htmlwebpack = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')

module.exports = {
  entry: path.join(__dirname, './src/index.js'),
  output: {
    path: path.join(__dirname, './main'),
    filename: 'index.js'
  },
  plugins: [
    new Htmlwebpack({
      template: path.join(__dirname, './src/index.html'),
      filename: 'index.html'
    }),
    new VueLoaderPlugin()
  ],
  module: {
    rules: [
      {test: /\.css$/, use: ['style-loader', 'css-loader']},
      {test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader']},
      { 
        test: /\.jpeg$/, 
        use: [
          {
            loader: 'url-loader',
            options: {
              limit: 100
            }
          }
        ]
      },
      { test: /\.vue$/, loader: 'vue-loader' },
    ]
  },
  mode: 'development'
}